<?php
namespace app\admin\controller;
use app\admin\Model\User as UserModel; 
class User extends Base {
	public function add() {
		//添加
		return "add";
	}
	public function del() {
		//删
		return "del";
	}
	
	public function profile() {
		//个人主页 修改密码
		return $this -> fetch();
	}
	public function lists() {
		//查看所有用户信息
      $method = $this->request->method();
		if($method=="GET"){
			return $this -> fetch();
		}else if($method == "POST"){
			//返回所有用户信息
			$obj["data"] = UserModel::field("id,username,nickname,professional,createdtime")->select();
			return json($obj);
		}
   }
}
?>